<?php
//$path = $_SERVER["DOCUMENT_ROOT"] . "/EPS/EPSWP/wp-content/themes/eps/";


require_once ('mailer/class.mailer.php');

// Init the Error string
$errors = "";
global $mailer;
$mailer = new eggMailer(); 

switch ( $_GET['action'] ) {
    case 'recover_password':
        $key = $session->publication->new_action_key();
        $recovery_url = BASE_URL . 'index.php?action=reset_pass&action_key=' . $key;
        echo $recovery_url;
        
            $mailer->validate_input_as($_SERVER['SERVER_NAME'], 'Website');
            $mailer->validate_input_as($recovery_url, 'RecoveryURL');
            $mailer->AddAddress('info@eggplantstudios.ca', 'Shawn Wernig');
            $mailer->send_mail('Password Recovery', 'password_recovery');
            $session->add_message('Please check your email for your password recovery link.');  
        break;
        

    default:
        $session->add_message('Email was not sent.');
        
} // End submit


?>